<?php 
	$tweet = $this->item->getStatus();
	$tweet	= preg_replace("|([[:alpha:]]+://[^[:space:]]+[[:alnum:]/])|",'<a href="\\1" rel="nofollow">\\1</a>',$tweet); // turn any URL’s into links
	$tweet	= preg_replace("|@([a-zA-Z0-9_]+)([^a-zA-Z0-9_])|",'@<a href="http://twitter.com/\\1">\\1</a>\\2',$tweet); // add “@username” links
?>

<?php if($this->item->getType() == SourceItem::IMAGE_TYPE) : ?>
<div class="twitter_image">
	<?php if ($this->item->getTitle()) : ?>
		<div class="titlewrapper">
			<div  class="title" id="title_<?= $this->count ?>"><?= $this->item->getTitle(); ?></div>
		</div>
	<?php elseif (!($this->item->getTitle()) && $this->edit) : ?>
		<div class="titlewrapper">
			<div  class="title" id="title_<?= $this->count ?>">[Click to add text]</div>
		</div>
	<?php endif ?>
	<div  class="content"><a href="<?= $this->item->getImageURL('medium'); ?>" title="<?= $this->item->getTitle(); ?>" rel="lightbox[set]" ><img src="<?= $this->item->getImageURL('small'); ?>" width="240"/></a></div>
</div>
<?php else : ?>
<div class="twitter">
		<table cellspacing=0><tr><td style="background: url('images/tweet.jpg') no-repeat">
		<div class="title"><span class="quote">&ldquo; </span><?= $tweet ?><span class="quote"> &rdquo;</span></div>
		<div class="triangle"></div>
		</td></tr></table>
</div>
<?php endif ?>
